<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:a="http://www.w3.org/2005/Atom"
		xmlns:func="http://exslt.org/functions"
		xmlns:str="http://exslt.org/strings"
		xmlns:dyn="http://exslt.org/dynamic"
		xmlns:ib="http://ionrock.org/ionblog/xslt/func"
		xmlns:xh="http://www.w3.org/1999/xhtml"
		xmlns:f="http://xmlns.4suite.org/ext"
		xmlns:bc="http://brightcontent.net/ns/"
		xmlns="http://www.w3.org/1999/xhtml"
		extension-element-prefixes="func str dyn ib" 
		exclude-result-prefixes="a xsl dyn str xh #default">

  <xsl:import href="../util.xslt"/>
  <xsl:param name="param-title">My Web Log</xsl:param>
  <xsl:param name="param-collection">ionrock</xsl:param>
  <xsl:param name="bc:weblog-base-uri" />
  <xsl:param name="bc:template_files"/>
  <xsl:param name="bc:brightcontent.archives.parse"/>
  <xsl:param name="bc:brightcontent.archives.history"/>
  <xsl:param name="bc:brightcontent.calendar.parse"/>
  <xsl:param name="bc:brightcontent.calendar"/>
  <xsl:output method="html" indent="yes" />

  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="a:feed">
<html 
    xml:lang="en" 
    lang="en" 
    xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title><xsl:value-of select="./a:title" /></title>
    <meta name="generator" content="Bright Content" />
    <link rel="stylesheet" href="{$bc:template_files}/ionrock/css/style.css" type="text/css" />
  </head>
  <body>
    <div id="main-container">
      <div id="page">
	<div id="main-header">
	  <h1>Ionrock Dot Org</h1>
	</div>
	<div id="sidebar">
  	  <h3>Calendar</h3>
        <xsl:copy-of select="dyn:evaluate($bc:brightcontent.calendar.parse)"/>
  	  <h3>Archives</h3>
  	  <ul>
        <xsl:for-each select="dyn:evaluate($bc:brightcontent.archives.parse)/*/link">
          <li>
            <a href="{@href}"><xsl:value-of select="@title"/></a>
    	    </li>
    	  </xsl:for-each>
  	  </ul>
	  <h3>Links</h3>
	  <ul class="links-list">
	    <li>
	      <a href=".">Blog</a> 
	      (<a href="./index.atom">feed</a>)
	    </li>
	  </ul>
	  <h3>About</h3>
	  <p> This site is a scratch pad. </p>
	  <h4>A little about myself</h4>
	  <p>I like to have a few paragraphs about myself here. You could also do 
          links or anything else.</p>
	  
	  <p>Outside of programming, I (elarson) play music in a band called
	  <a href="http://umemusic.com">Ume</a>. We play a somewhat
	  aggressive/noisy rock and have a blast doing it. This little bit in the
          template is just my little way of promoting so feel free to download an song
          or two and delete this paragraph :)</p>
	</div>
	<div id="main-content">
	  <xsl:variable name="root-node" select="." />
	  <h3><xsl:value-of select="$param-title" /></h3>
	  <xsl:apply-templates />
	</div>
      </div>
    </div>
  </body>
</html>
  </xsl:template>
  
  <func:function name="ib:blog-id">
    <xsl:param name="old-id" />
    <xsl:variable name="old-base">http://ionrock.org/atom</xsl:variable>
    <xsl:variable name="new-base">/blogs/view</xsl:variable>
    <func:result select="str:replace($old-id, $old-base, $new-base)" />
  </func:function>
  
  <xsl:template match="a:entry">
    <div class="blog-entry">
      <h4><xsl:value-of select="a:title" /></h4>
      <div class="blog-content">
	<xsl:apply-templates />
      </div>
      <div class="blog-details">
	Posted: <xsl:value-of select="a:published" /><br />
	<xsl:if test="string(a:published) != string(a:updated)">
	 Updated: <xsl:value-of select="a:updated" /><br />
	</xsl:if>
	By <xsl:apply-templates select="a:author" mode="text-construct" />
	<xsl:apply-templates select="a:link" mode="links" />
      </div>
    </div>
  </xsl:template>

  <xsl:template match="a:content[@type = 'xhtml']" mode="not-used">
    <xsl:copy-of select="." />
  </xsl:template>

  <xsl:template match="a:author" mode="text-construct">
    <xsl:value-of select="a:name" />
  </xsl:template>

  <xsl:template match="a:link" mode="links">
    <a href="{@href}">
      <xsl:if test="@type">
        <xsl:text> (</xsl:text><xsl:value-of select="@type"/><xsl:text>): </xsl:text>
      </xsl:if>
      <xsl:value-of select="@title"/>
    </a>
    <xsl:if test="position() != last()">
      <xsl:text> | </xsl:text>
    </xsl:if>
  </xsl:template>


</xsl:stylesheet>